using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class SalesOrderHeaderSalesReasonConfiguration : EntityTypeConfiguration<SalesOrderHeaderSalesReason>
    {
        public SalesOrderHeaderSalesReasonConfiguration()
        {
            ToTable("Sales.SalesOrderHeaderSalesReason");
            HasKey(x => new {x.SalesOrderId, x.SalesReasonId});

            Property(x => x.SalesOrderId)
                .HasColumnName("SalesOrderID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.SalesReasonId)
                .HasColumnName("SalesReasonID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}